<?php

$app->HandleFunc("/",function() {
    $data = array(
	"ret" => 0,
	"data" => "欢迎使用"
	);
    $this->ServerJson($data);
});


$app->HandleFunc("/hello",function() {
    $test_model = new Test_models($this);
    $data = $test_model->getall();
    $this->ServerJson($data);
});

$app->HandleFunc("/test",function() {
    $data = array(
    "ret" => 0,
    "data" => "test hhh"
    );
    $this->ServerJson($data);
});

$app->HandleFunc("/db",function() {
    $data = array(
    "ret" => 0,
    "data" => "test hhh"
    );
    $list = $this->db->query("select * from fa_online limit 1")->fetch_all(MYSQLI_ASSOC);
    $this->ServerJson(32);
});


